import java.lang.reflect.Array;
import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
        String str = "BAabB";

        char[] arr = str.toCharArray();
        char[] arr1 =  new char[20];
        for(int i = 0; i < str.length(); i++) {

            for (int j = 1; j <str.length()-1 ; j++) {

                if(arr[i] !=arr[j]) {
                   arr1[i]=arr[i];

                }else{
                   break;
                }
            }

        }

        System.out.println(Arrays.toString(arr1));

    }
}
